package com.huxi.lang.type;

import java.text.MessageFormat;

public class DateParseException extends IllegalArgumentException {

	private static final long serialVersionUID = 1L;

	private final String pattern;

	public DateParseException(String pattern, String value, Throwable cause) {
		super(MessageFormat.format("illegal '{0}' format date - {1}", pattern, value), cause);
		this.pattern = pattern;
	}

	public DateParseException(String pattern, String value) {
		super(MessageFormat.format("illegal '{0}' format date - {1}", pattern, value));
		this.pattern = pattern;
	}

	public String pattern() {
		return pattern;
	}

}
